<?php

class ValidatorZipCode extends sfValidatorNumber {
  
    protected function doClean($value)
  {
  
    $original_strlen = strlen($value);
    $value = parent::doClean($value);
    
    while(strlen($value) < $original_strlen) {
    	$value = '0'.$value;
    }
    
      if (strlen($value) != 5)
    {
      throw new sfValidatorError($this, 'invalid');
    }
    
    return $value;
  }
}